package com.andy.nature.vm

import androidx.lifecycle.MutableLiveData
import com.andy.common.base.BaseViewModel
import com.andy.nature.model.TestBean

/**
 * Author:Andy
 * Date:2023/3/20 16:19
 * Description:TestViewModel
 */
class CommonViewModel : BaseViewModel() {
    val testLiveData = MutableLiveData<List<TestBean>>()

    init {
        getTestList()
    }

    fun getTestList(): ArrayList<TestBean> {
        val list = ArrayList<TestBean>()
        for (i in 1..20) {
            val item = TestBean()
            item.name = "张${i}狗"
            item.content = "我是${i}内容---"
            item.avatar = ""
            item.showRed = i % 3 == 0
            item.unReadNum = 0
            list.add(item)
        }
        testLiveData.postValue(list)
        return list
    }
}